package org.linlinjava.litemall.db.models;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.math.BigDecimal;
import java.time.LocalDateTime;

@Getter
@Setter
@ToString
@EqualsAndHashCode(callSuper = false)
@TableName(value = "t_coupon", autoResultMap = true)
public class Coupon extends BaseModel{

    @TableField("name")
    private String name;

    @TableField("`desc`")
    private String desc;

    @TableField("tag")
    private String tag;

    @TableField("total")
    private Integer total;

    @TableField("discount")
    private BigDecimal discount;

    @TableField("min")
    private BigDecimal min;

    @TableField("`limit`")
    private Short limit;

    @TableField("type")
    private Short type;

    @TableField("status")
    private Short status;

    @TableField("goods_type")
    private Short goodsType;

    @TableField(value = "goods_value", typeHandler = JacksonTypeHandler.class)
    private Integer[] goodsValue;

    @TableField("code")
    private String code;

    @TableField("time_type")
    private Short timeType;

    @TableField("days")
    private Short days;

    @TableField("start_time")
    private LocalDateTime startTime;

    @TableField("end_time")
    private LocalDateTime endTime;

}